#ifndef __HDVB_STREAM_INFO_H
#define __HDVB_STREAM_INFO_H
/*
    libhdvbd - Library for building sophisticated DVB applications
    Copyright (C) 2012 Tony Houghton <h@realh.co.uk>

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

/* Information about the streams making up a service/programme */

#include <glib.h>

#include <linux/dvb/dmx.h>

#include <hdvb/section.h>
#include <hdvb/hdvb-receiver.h>

G_BEGIN_DECLS

typedef struct {
    int pid;
    int stream_type;
    dmx_pes_type_t pes_type;
    HdvbPMTStreamInfo *pmt_info;
} HdvbStreamInfo;

typedef struct {
    int service_id;
    int pmt_pid;
    int ts_id;
    int pcr_pid;
    GList *streams;     /* List of HdvbStreamInfo */
} HdvbServicePidsInfo;

dmx_pes_type_t
hdvb_stream_info_get_pes_type(const HdvbPMTStreamInfo *si);

HdvbServicePidsInfo *
hdvb_service_pids_info_copy(const HdvbServicePidsInfo *src);

/* Only call on one created by copy */
void
hdvb_service_pids_info_delete(HdvbServicePidsInfo *info);

/* Request ts filters for described pids */
int
hdvb_service_pids_info_request_filters(const HdvbServicePidsInfo *info,
        HdvbReceiver *rcv);

G_END_DECLS

#endif /* __HDVB_STREAM_INFO_H */
